﻿@using InfoTech.VinhSon.Bussiness
@model Article
@{
    ViewBag.Title = Model.Name;
    Layout = "~/Views/Shared/_2Column.cshtml";
}
@section rightcolumn
{
     @Html.Action("RightColumn")
}
@section css
{
    <style type="text/css">
        .same-category-title {
            margin-top: 20px;
            font-size: 16px;
            text-align: center;
            color: #6c3403;
        }
        .same-category-list {
            margin-left: 150px;
            margin-right: 50px;
        }
        .same-category-list li {
            list-style: square;
            margin: 5px;
        }
        .same-category-list li a {
            text-decoration: none;
            color: #0377BA;
            font-size: 13px;
        }
        .same-category-list li a:hover {
            text-decoration: underline;
            color: #6c3403;
        }
        .line-seperator {
            width: 300px;
            margin: 0 auto;
            border-bottom: 1px dotted #ccc;
        }
        .article_title1 {
            float: left;
        }
        .article_time1 {
            float: right;
            color: #0377BA;
            font-style: italic;
        }
    </style>
}
<div class="article_category_title1">
    <a href="@Model.Category.GetUrl()">@Model.Category.Name </a>
</div>
<div class="article_title1">
    @Model.Name
</div>
<div class="article_time1">Cập nhật: @string.Format("{0:dd/MM/yyyy HH:mm}", Model.LastModified)</div>
<div class="clear"></div>
@Html.Raw(Model.Detail)
<div class="clear">
</div>
@{
    if (Model.Sections.Any())
    {
        foreach (Section item in Model.Sections.Where(c => c.Inactive == false).OrderByDescending(c => c.Priority))
        {
            if (item.Type == Section.SECTION)
            {
    <div class="section-document-title">@item.Name</div>
    <div class="section-document-detail">
        @Html.Raw(item.Detail)
    </div>
            }
            else if (item.Type == Section.IMAGE)
            {
    <div class="section-image-title" align="center">
        <img src="/Resource/Images/@item.Url" alt="@item.Name"/>
        <br />
        @item.Name
    </div>
    <div class="section-image-detail">
        @Html.Raw(item.Detail)
    </div>
            }
            else if (item.Type == Section.VIDEO)
            {
    <div class="section-video-title" align="center">
        <iframe width="@item.Width??400" height="@item.Height??400" src="//www.youtube.com/embed/@item.Url" frameborder="0" allowfullscreen>
        </iframe>
        <br />
        @item.Name
    </div>
    <div class="section-video-detail">
        @Html.Raw(item.Detail)
    </div>
            }
    <div class="clear">
    </div>
        }
    }
}
@{
    List<Article> q0 = (List<Article>)ViewBag.CategoryArticles;
    if (q0 != null)
    {
        if (q0.Any())
        {
    <div class="same-category-title">
        BÀI VIẾT CÙNG CHỦ ĐỀ</div>
    <div class="line-seperator">
    </div>
    <ul class="same-category-list">
        @{
            foreach (Article item in q0)
            {
            <li><a href="@item.GetUrl()" title="@item.Description">@item.Name (@string.Format("{0:dd/MM/yyyy HH:mm}", item.LastModified))</a></li>
            }
        }
    </ul>            
        }
    }
}
